package totoCharts;
import java.util.List;

import guestbook.abstractRequestServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/*
 * this class returns how many times '1' was filled, '2' was filled and 'x' was
 * filled for a specific match (according to the gadget's request). it is here to
 * support the ask the crowd feature- it gets the data for the google visualization
 * API that creates the pie charts according to this data
 */

public class gadgetRequestTotoChart extends abstractRequestServlet<totoGeneralFillout>
{    
	/**
	 * 
	 */
	private static final long serialVersionUID = 7010021366742169800L;

	public void doGet(HttpServletRequest req, HttpServletResponse resp)
	 
	{
			try
			{
				List<totoGeneralFillout> list;
				String result="error";
				list=getData(totoGeneralFillout.class);
				for (totoGeneralFillout elem: list){
					result= elem.toString();
				}
				writeToServlet(resp,result);
				
			}
			catch (Exception e) /* catches exception for the gadget*/
			{
				pmClose();
			} 
			    
	}
}



